<template>
  <div class="product_detail" curpage="productDetail123243453454354">
    <layoutContent>
      <template #left>
        <ProductLeft @addKey="showPage"></ProductLeft>
      </template>
      <template #right>
        <!-- 商品图片 -->
        <PicturesVdeioCom v-bind="detailProps" v-if="menuType === 'img_and_video'"></PicturesVdeioCom>
        <!-- 单证详情 -->
        <documentCom v-if="menuType === 'certify'" v-bind="detailProps"></documentCom>
        <!-- sku 信息 -->
        <ProductSkuCard v-if="menuType === 'sku_info'" />
		<!--操作日志-->
		<OperationLog v-if="menuType === 'operation_log'"></OperationLog>
      </template>
    </layoutContent>
  </div>
</template>
<script lang="ts" setup name="goodsDetailMessage">
import { ref, reactive } from "vue";
import layoutContent from "@/components/LayoutComponents/index.vue";
import PicturesVdeioCom from "./components/PicturesVideo/index.vue";
import documentCom from "./components/DocumentFile/index.vue";
import ProductLeft from "./components/ProductLeft/index.vue";
import OperationLog from "./components/OperationLog/index.vue";
import { getLocationParams } from "@/utils/index";

import ProductSkuCard from "@/views/goodsArchive/ProductCard/index.vue";

const goodsId = ref(0);
const productId = ref(0);
const menuType = ref("");
//接收url参数
const newUrl = new URL(window.location.href);
goodsId.value = getLocationParams(newUrl.href, "g_id") ?? 0;
productId.value = getLocationParams(newUrl.href, "p_id") ?? 0;
const detailProps = reactive({
  goodsId: goodsId, //'1751042'////'1751098'"1751098"
  productId: productId.value
});
const showPage = row => {
  console.log(row);
  menuType.value = row;
};
</script>
<style lang="scss" scoped>
@import url("./productDetails.scss");
</style>
